Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix overencode; fix double-decode #10

Merged
merged 6 commits into from
Mar 16, 2016
Merged

fix overencode; fix double-decode #10

merged 6 commits into from
Mar 16, 2016

Conversation

forresto
Copy link
Contributor

Switch to he

Also fix a double-decode bug where & would show as & instead of expected &

@forresto forresto changed the title fix overencode WIP -- fix overencode Mar 16, 2016
@forresto forresto changed the title WIP -- fix overencode fix overencode Mar 16, 2016
@bergie
Copy link
Contributor

bergie commented Mar 16, 2016

Note that we're using entities here since that is what html-flatten uses as well

@@ -76,7 +79,7 @@ export default class CEd {
this.id = block.id
let el = document.createElement('div')
el.innerHTML = this.block.html
this.editor.setValue(decodeHTML(el.textContent))
this.editor.setValue(decode(el.textContent))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this decode? Seems like el.textContent would already be decoded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug: turns & into & expected &

@forresto
Copy link
Contributor Author

@bergie #4 is desired behavior?

@forresto forresto changed the title fix overencode fix overencode; fix double-decode Mar 16, 2016
dummy el.textContent works
forresto added a commit to the-grid/html-flatten that referenced this pull request Mar 16, 2016
bergie added a commit that referenced this pull request Mar 16, 2016
@bergie bergie merged commit e9ad0f6 into master Mar 16, 2016
@bergie bergie deleted the support/fix-overencode branch March 16, 2016 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants